home *** CD-ROM | disk | FTP | other *** search
/ Macromedia Multimedia Showcase 5.1 / Macromedia - Multimedia Showcase 5.1 (Macromedia) (1996).ISO / pc / media / shared.dir / 02000_Script_authoring routines next >
Text File  |  1996-03-28  |  6KB  |  200 lines

  1. -- AUT: AUTHORING TOOLS SCRIPT
  2.  
  3. on InitAuthoringTools  
  4.   if the optionDown then
  5.     -- put #InitAuthoringTools
  6.     -- installMenu cast "Authoring Menu"
  7.     
  8.     set toolsFileName = the pathName & "XAUTH_02.DIR"
  9.     
  10.     OpenMIAW(toolsFileName)
  11.   end if
  12. end InitAuthoringTools
  13.  
  14. --
  15.  
  16. on DisposeAuthoringTools
  17.   CloseMIAW()
  18.   put #DisposeAuthoringTools
  19. end DisposeAuthoringTools
  20.  
  21. --
  22.  
  23. on OpenMIAW whichFile
  24.   -- put #OpenMIAW
  25.   global gWindowObj, gExtWindowFileName
  26.   if objectP(gWindowObj) then
  27.     forget gWindowObj
  28.   end if
  29.   if objectP( movieFile ) then movieFile( mDispose )
  30.   
  31.   if voidP(whichFile) then
  32.     put FileIO( mNew, "?read", "MV93" ) into movieFile
  33.     if movieFile = -43 then
  34.       set errMsg = "No authoring tools file specified." & return & return & "Halting program."
  35.       HaltProgram(errMsg)
  36.     end if
  37.     put movieFile( mFileName ) into gExtWindowFileName  
  38.   else
  39.     set gExtWindowFileName = whichFile
  40.     --    if voidP(gExtWindowFileName) then
  41.     --      set errMsg = "Authoring Tools not found." & return & return & "Exiting program."
  42.     --      HaltProgram(errMsg)
  43.     --    end if  
  44.   end if
  45.   
  46.   set myWindowWidth = 400
  47.   set myWindowHeigth = 230
  48.   set horzOrigin = 828 - myWindowWidth
  49.   set vertOrigin = the stageTop+20
  50.   set myWindowRect to rect(horzOrigin, vertOrigin, ¼
  51.   horzOrigin + myWindowWidth, vertOrigin + myWindowHeigth)
  52.   set gWindowObj to window gExtWindowFileName
  53.   set the rect of gWindowObj to myWindowRect
  54.   set the fileName of gWindowObj to gExtWindowFileName
  55.   set the title of gWindowObj = "Xronos Authoring Tools"
  56.   set the titleVisible of gWindowObj to TRUE
  57.   open gWindowObj
  58.   moveToBack window gExtWindowFileName
  59. end OpenMIAW
  60.  
  61. --
  62.  
  63. on HaltProgram whichMsg  
  64.   if voidP(whichMsg) then
  65.     set whichMsg = "Unknown error. Halting program."
  66.   end if
  67.   alert whichMsg
  68.   halt
  69. end HaltProgram
  70. --
  71.  
  72. on CloseMIAW
  73.   global gWindowObj
  74.   if objectP(gWindowObj) then
  75.     forget gWindowObj
  76.   end if
  77. end 
  78.  
  79. --
  80.  
  81. on PurgeQuick startCast, endCast
  82.   repeat with i = startCast to endCast
  83.     set the purgePriority of cast i = 2 -- purge "first", or "next"
  84.   end repeat
  85.   put #done
  86. end PurgeQuick
  87.  
  88. --
  89.  
  90. on CheckBitDepth lastCast
  91.   --  if voidP(lastCast) then
  92.   --    alert "enter last cast you want to check"
  93.   --    halt
  94.   --  end if
  95.   set lastCast = the number of castmembers
  96.   repeat with i = 1 to lastCast 
  97.     if (the castType of cast i = #bitmap) then      
  98.       set myDepth = the depth of cast i
  99.       if myDepth > 8 then
  100.         put #cast && i && #bitdepth && myDepth
  101.       end if
  102.     end if
  103.   end repeat
  104.   put #checked && lastCast && #castmembers
  105.   
  106. end CheckBitDepth
  107.  
  108. --
  109.  
  110. on testAnimList
  111.   global gNavObj, gAnimationScreenList  
  112.   repeat with i = 0 to 120
  113.     findPosNear gAnimationScreenList, i
  114.     set myPos = the result
  115.     set myLast = count(gAnimationScreenList)  
  116.     if myPos > myLast then
  117.       set myPos = myLast
  118.     end if
  119.     getAt gAnimationScreenList, myPos
  120.     set myScene = the result
  121.     put i && myScene
  122.     JumpSequence(myScene)
  123.   end repeat  
  124. end testAnimList
  125.  
  126. --
  127.  
  128. on GetLinksAndScenes
  129.   -- for test purposes only; creates a list of all links and their director fiile name
  130.   global castIdPtr, sBirthPtr
  131.   set myNavList = value(the text of field "Compiled*Navigation*List") -- I bet this no longer works
  132.   set myEventList = value(the text of field "Compiled*Event*List")
  133.   set myLast = count(myEventList)
  134.   repeat with i = 1 to myLast
  135.     getAt myEventList, i
  136.     set myEvents = the result
  137.     repeat with j = 1 to count(myEvents)
  138.       getAt myEvents, j
  139.       set curEvent = the result
  140.       if item castIdPtr of curEvent contains "L" then
  141.         set myScene = item sBirthPtr of curEvent
  142.         getProp myNavList, myScene
  143.         set sceneData = the result
  144.         set DirFile = item 4 of sceneData & ".DIR"
  145.         put DirFile & " contains" && item castIdPtr of curEvent
  146.       end if
  147.     end repeat
  148.   end repeat
  149. end GetLinksAndScenes
  150.  
  151. --
  152.  
  153. on parseATPtext
  154.   -- Specific routine to take the ATP database (training providers) and turn it into a list
  155.   --   structure.  Database was changed from tab-delimited to '%' delimited, copied into 
  156.   --   a text castmember ('ATP text') then parsed.  The resulting list was saved into
  157.   --   a different text cast member ('ATP list').
  158.   --   The records get sorted into the list by phone prefix.
  159.   set theText = the text of field "ATP text"
  160.   set destinationList = [ : ]
  161.   set currentPrefix = 0
  162.   set thisPrefixList = [ ]
  163.   set oldDelimiter = the itemDelimiter
  164.   set the itemDelimiter = "%"
  165.   set prefixItemNum = 5
  166.   repeat with aLine = 1 to the number of lines of theText
  167.     set tempLine = line aLine of theText
  168.     set tempPrefix = item(prefixItemNum) of tempLine
  169.     set thisItemList = [ ]
  170.     repeat with anItem = 1 to the number of items of tempLine
  171.       set tempItem = item anItem of tempLine
  172.       append(thisItemList, tempItem)
  173.     end repeat
  174.     if tempPrefix = currentPrefix then
  175.       append(thisPrefixList, thisItemList)
  176.     else
  177.       -- starting a new prefix
  178.       if count(thisPrefixList) > 0 then
  179.         -- done with last prefix, add its list to the main list
  180.         addProp (destinationList, currentPrefix, thisPrefixList)
  181.       end if
  182.       set currentPrefix = tempPrefix
  183.       set thisPrefixList = [ thisItemList ]
  184.     end if
  185.   end repeat
  186.   if count(thisPrefixList) > 0 then
  187.     addProp (destinationList, currentPrefix, thisPrefixList)
  188.   end if
  189.   put destinationList into field "ATP List"
  190.   set the itemDelimiter = oldDelimiter
  191. end parseATPtext
  192.  
  193. -- 
  194.  
  195. on mouseDown
  196.   global lastMouseEvent
  197.   set lastMouseEvent = the ticks
  198.   pass
  199. end mouseDown
  200.